<div class="modal fade" role="dialog" id="user" aria-labelledby="title">
  <form name="myForm" novalidate>
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal"
                  aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h4 class="modal-title">设置角色</h4>
        </div>
        <div class="modal-body">
          <div class="container-fluid">
            <div class="row">
              <div class="col-xs col-md-12">
                <div class="input-group">
									<span class="input-group-addon" id="sizing-addon2"><i
                    class="fa fa-unlock-alt "></i> </span> <select name="rid" required
                                                                   class="form-control select2"
                                                                   ng-model="rid"
                                                                   style="width: 100%;">
                  <option value="" disabled>设置角色</option>
                  <option ng-repeat="role in roles" value="{{role.rid}}">{{role.rname}}</option>
                </select>
                </div>
              </div>
            </div>
            <div class="alert alert-warning alert-dismissible">
              <h4>
                <i class="icon fa fa-warning"></i>注意！
              </h4>
              此项操作将改变用户的权限及网站视图，请谨慎操作。
            </div>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            <button type="button" class="btn btn-primary" ng-click="save();">更改</button>
          </div>
        </div>
        <!-- /.modal-content -->
      </div>
      <!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->
  </form>
</div>
<!-- Content Wrapper. Contains Page content -->
<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    用户管理
    <small>用户相关操作</small>
  </h1>
  <ol class="breadcrumb">
    <li><a href="#/index"><i class="fa fa-dashboard"></i> 主页</a></li>
    <li class="active">用户列表</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">
  <div class="row">
    <div class="col-xs-12">
      <div class="box">
        <div class="box-header">
          <h3 class="box-title col-xs col-sm-6">用户列表</h3>
          <hr>
          <div class="row">
            <div class="col-xs col-md-6">
              <div class="col-xs col-sm-4">
                <button privilege="添加用户" class="btn btn-primary " ng-click="addUser()">
                  <span>添加用户</span>
                </button>
              </div>
            </div>
            <div class="col-xs col-md-6">
              <div class="col-xs col-sm-4"></div>
              <div class="col-xs col-sm-6">
                <i class="fa fa-search"></i> <input type="text"
                                                    ng-change="changeCD();" ng-model="condition"
                                                    placeholder="用户名/密码/邮箱等搜索">
              </div>
            </div>
          </div>
        </div>
        <!-- /.box-header -->
        <div class="box-body">
          <table id="example1"
                 class="table table-condensed table-bordered table-striped table-hover mytable">
            <thead>
            <tr>
              <th>用户名</th>
              <th>邮箱</th>
              <th>所属单位</th>
              <th>角色</th>
              <th>地址</th>
              <th>姓名</th>
              <th>注册时间</th>
              <th ng-show="opt">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="user in page.recordList">
              <td ng-bind-html="user.username|highlightText:condition"></td>
              <td ng-bind-html="user.email|highlightText:condition"></td>
              <td ng-bind-html="user.cname|highlightText:condition"></td>
              <td ng-bind-html="user.rname|highlightText:condition"></td>
              <td ng-bind-html="user.address|highlightText:condition"></td>
              <td ng-bind-html="user.realname|highlightText:condition"></td>
              <td ng-bind-html="user.registerdate|highlightText:condition"></td>
              <td>
                <button privilege="删除用户" ng-click="del(user.username)" class="btn-xs btn-danger">
                  <span>删除</span>
                </button>
                <button privilege="设置用户角色" ng-click="edit($index)" class="btn btn-warning btn-xs">
                  <span>设置角色</span>
                </button>
              </td>
            </tr>
            </tbody>
          </table>
          <div ui-view="pagebar"></div>
        </div>
        <!-- /.box-body -->
      </div>
      <!-- /.box -->
    </div>
    <!-- /.col -->
  </div>
  <!-- /.row -->
</section>
<!-- /.content -->
<!-- Add the sidebar's background. This div must be placed
           immediately after the control sidebar -->
<div class="control-sidebar-bg"></div>
